<form name="frmlist" id="frmlist" action="<?php echo $this->site['base_url']?>admin_inventory/search" method="post">
<table class="title" cellspacing="0" cellpadding="0">
  <tr>
    <td class="title_label"><?php echo Kohana::lang('inventory_lang.tt_page')?></td>
    <td class="title_button">
    <button type="button" name="btn_new" class="button new" onclick="javascript:location.href='<?php echo $this->site['base_url']?>admin_inventory/create'"/>
    <span><?php echo Kohana::lang('inventory_lang.btn_new_input') ?></span>
    </button>
    &nbsp;
    <button type="button" name="btn_list" class="button report" onclick="sm_print(frmlist,'<?php echo $this->site['base_url']?>admin_inventory_list')"/>
    <span><?php echo Kohana::lang('inventory_lang.btn_list') ?></span>
    </button>
    </td>
  </tr>
</table>
<table class="list_top" cellspacing="0" cellpadding="0">
  <tr>
    <td><?php echo Kohana::lang('admin_lang.lbl_search')?>:
    <input name="txt_keyword" type="text" id="txt_keyword" value="<?php if(isset($keyword)) echo $keyword ?>"/>
    &nbsp;
    <select name="sel_status" id="sel_status">
    	<option value="0">---</option>
		<option value="1" <?php if(isset($status) && $status == 1) echo 'selected="selected"'?> ><?php echo Kohana::lang('inventory_lang.lbl_input')?></option>
		<option value="2" <?php if(isset($status) && $status == 2) echo 'selected="selected"'?> ><?php echo Kohana::lang('inventory_lang.lbl_output')?></option>
	</select>
    &nbsp;
	<button type="submit" name="btn_search" class="button search"/>
    <span><?php echo Kohana::lang('admin_lang.btn_search')?></span>
    </button>
    </td>
  </tr>
</table>
<table class="list" cellspacing="1" cellpadding="5">
  <tr class="list_header">
    <!--<td width="10"><input type="checkbox" name="checkbox" value="checkbox" onclick='checkedAll(this.checked);'></td>-->
    <td width="50"><?php echo Kohana::lang('admin_lang.lbl_status')?></td>
    <td><?php echo Kohana::lang('invoice_lang.lbl_date')?></td>    
    <td><?php echo Kohana::lang('inventory_lang.lbl_from_to')?></td>
    <td><?php echo Kohana::lang('inventory_lang.lbl_vendor_name')?></td>
    <td><?php echo Kohana::lang('product_lang.lbl_id')?></td>
    <td><?php echo Kohana::lang('product_lang.lbl_name')?></td>
    <td><?php echo Kohana::lang('inventory_lang.lbl_remark')?></td>
    <td><?php echo Kohana::lang('product_lang.lbl_weight')?></td>
    <td><?php echo Kohana::lang('product_lang.lbl_qty')?></td>  
    <td width="50"><?php echo Kohana::lang('admin_lang.lbl_action')?></td>  
  </tr>
  <?php for($i=0; $i<count($mlist); $i++){ ?>
  <tr class="row<?php echo $i%2==0?2:''?>">
    <!--<td><input name="chk_id[]" type="checkbox" id="chk_id[]" value="<?php echo $mlist[$i]['inventory_id']?>"></td>-->
    <td align="center">
      <?php if($mlist[$i]['inventory_status'] == 1){ ?>
        <img src="<?php echo $this->site['theme_url']?>pics/icon_plus.png" title="In"/>
      <?php } else { ?>    
        <img src="<?php echo $this->site['theme_url']?>pics/icon_minus.png" title="Out"/>
      <?php } ?>
    </td>    
    <td align="center"><?php echo $mlist[$i]['inventory_date']?></td>
    <td align="center"><?php echo $mlist[$i]['inventory_description']?></td>
    <td align="center"><?php echo $mlist[$i]['vendors_name']?></td>    
    <td align="center"><?php echo $mlist[$i]['products_id']?></td>
    <td align="left">
	<a href="<?php echo $this->site['base_url']?>admin_inventory_list/product/<?php echo $mlist[$i]['products_id']?>" target="_blank">
	<?php echo $mlist[$i]['products_name']?>
    </a>
    </td>
    <td align="left"><?php echo $mlist[$i]['inventory_remark']?></td>    
    <td align="center"><?php echo $mlist[$i]['products_weight']?> <?php echo $this->site['site_unit']?></td>
    <td align="center">
		<?php if($mlist[$i]['inventory_status'] == 1){ ?>
        <font color="#0000FF">+ <?php echo $mlist[$i]['products_qty']?></font>
      	<?php } else { ?>    
        <font color="#FF0000">- <?php echo $mlist[$i]['products_qty']?></font>
      	<?php } ?>      	
	</td>
    <td align="center">
    <a href="<?php echo $this->site['base_url']?>admin_inventory/delete/<?php echo $mlist[$i]['inventory_id']?>" onclick="return confirm('<?php echo Kohana::lang('errormsg_lang.msg_confirm_del')?>')">
    <img src="<?php echo $this->site['base_url']?>themes/admin/pics/icon_delete.png" title="<?php echo Kohana::lang('admin_lang.btn_delete')?>" />
    </a>
    &nbsp;
    <a href="<?php echo $this->site['base_url']?>admin_inventory_list/product/<?php echo $mlist[$i]['products_id']?>" target="_blank">
    <img src="<?php echo $this->site['base_url']?>themes/admin/pics/icon_report.png" title="<?php echo Kohana::lang('product_lang.lbl_product_inventory')?>" />
    </a>
    </td>
  </tr>
  <?php } ?>
</table>
</form>
<div class='pagination'><?php if(isset($this->pagination))echo $this->pagination?></div>